class FloodTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'Flood'

    def add_to_player( self , player ):
        player.floods().append( self )

class RiverTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'River'

    def add_to_player( self , player ):
        player.rivers().append( self )

class GodTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'God'

    def add_to_player( self , player ):
        player.gods().append( self )

class RaTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'Ra'

class CivTile:
    _flavors = [ 'Green' , 'Gray' , 'Red' , 'Blue' , 'Yellow' ]
    _scores = [ -5 , 0 , 0 , 5 , 10 , 15 ]
    def __init__( self , flavor ):
        self._flavor = CivTile._flavors[ flavor ]

    def __repr__( self ):
        return self._flavor + ' Civ'

    def add_to_player( self , player ):
        player.civs().append( self )

    def flavor( self ):
        return self._flavor

class MonumentTile:
    _unique_scores = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 10 , 15 ]
    _same_scores = [ 0 , 0 , 0 , 5 , 10 , 15 ]
    def __init__( self , flavor ):
        self._flavor = flavor

    def __repr__( self ):
        return 'Monument(%d)' % self._flavor

    def add_to_player( self , player ):
        player.monuments().append( self )

    def flavor( self ):
        return self._flavor

class PharaohTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'Pharaoh'

    def add_to_player( self , player ):
        player.pharaohs().append( self )

class GoldTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'Gold'

    def add_to_player( self , player ):
        player.golds().append( self )

class DroughtTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'Drought'

    def add_to_player( self , player ):
	player._destructive.append( self )

    def destruct( self , player ):
        removed = 0
        while removed < 2 and len( player.floods() ):
            player.floods().pop()
            removed += 1

        if removed == 2:
            return

        while removed < 2 and len( player.rivers() ):
            player.rivers().pop()
            removed += 1

class EarthquakeTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'Earthquake'

    def add_to_player( self , player ):
	player._destructive.append( self )

    def destruct( self , player ):
        monuments_to_remove = player._controller.earthquake( player.monuments() )
	for monument_to_remove in monuments_to_remove:
	    if monument_to_remove is not None:
		player.monuments().remove( monument_to_remove )

class PestilenceTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'Pestilence'

    def add_to_player( self , player ):
	player._destructive.append( self )

    def destruct( self , player ):
        removed = 0
        while removed < 2 and len( player.pharaohs() ):
            player.pharaohs().pop()
            removed += 1
            
class FamineTile:
    def __init__( self ):
        pass

    def __repr__( self ):
        return 'Famine'

    def add_to_player( self , player ):
	player._destructive.append( self )

    def destruct( self , player ):
        civs_to_remove = player._controller.famine( player.civs() )
	for civ_to_remove in civs_to_remove:
	    if civ_to_remove is not None:
		player.civs().remove( civ_to_remove )
